namespace Org.Loon.Framework.Xna.Game.Action.Collision {
	
	using Org.Loon.Framework.Xna.Game.Core.Geom;
	using Org.Loon.Framework.Xna.Game.Core.Graphics.OpenGL;
	
	public class CollisionEvent {
	
		public sealed class _Collidable : Collidable {

			private readonly LTexture texture;

			private readonly object xref;

			private CollisionMask cmask;

			private Shape shape;

            public _Collidable(LTexture tex, object xref)
            {
                this.texture = tex;
				this.xref = xref;
			}
	
			public object GetRef() {
				return xref;
			}
	
			public CollisionMask GetMask() {
				if (cmask != null) {
					return cmask;
				}
				return (cmask = new CollisionMask(texture.GetMask()));
			}
	
			public Shape GetShape() {
				if (shape != null) {
					return shape;
				}
				return (shape = texture.GetShape());
			}
		}
	
		private Collidable collidedWith;
	
		public CollisionEvent(LTexture texture_0, object xref) {

            this.collidedWith = new CollisionEvent._Collidable(texture_0, xref);
		}
	
		public Collidable GetCollidable() {
			return collidedWith;
		}
	
	}
}
